//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Exception Handling Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.ExceptionHandling.Configuration.Design.Properties;

namespace EntLibContrib.ExceptionHandling.Configuration.Design
{
	/// <summary>
	/// Node map registrar for exception handling
	/// </summary>
	public sealed class ExceptionHandlingNodeMapRegistrar : NodeMapRegistrar
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ExceptionHandlingNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public ExceptionHandlingNodeMapRegistrar(IServiceProvider serviceProvider)
			: base(serviceProvider)
		{
		}
		#endregion

		#region Public Methods
		/// <summary>
		/// Registers the node maps.
		/// </summary>
		public override void Register()
		{
			AddMultipleNodeMap(Resources.SqlExceptionWrapHandlerNodeUICommandText, typeof(SqlExceptionWrapHandlerNode), typeof(SqlExceptionWrapHandlerData));

			AddMultipleNodeMap(Resources.ErrorCodeEntryNodeUICommandText, typeof(ErrorCodeEntryNode), typeof(ErrorCodeEntryData));
		}
		#endregion
	}
}
